//
//  HX_AddMailList.m
//  UI17 - Mail-List
//
//  Created by 韩旭 on 16/8/6.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "HX_AddMailList.h"
#import "MailModel.h"

@interface HX_AddMailList ()
@property (nonatomic, strong) UITextField *fieldName;
@property (nonatomic, strong) UITextField *fieldAdress;
@property (nonatomic, strong) UITextField *fieldTelePhone;
@property (nonatomic, strong) UITextField *fieldGender;

@end

@implementation HX_AddMailList

- (void)viewDidLoad {
    [super viewDidLoad];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.view.backgroundColor = COLORAUTO;
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(backGround:)];
    [self creatFieldText];
}
- (void)backGround:(UINavigationBar *)bar {
    if (_fieldName.text.length > 0) {
   
    MailModel *model = [[MailModel alloc] init];
    model.name = _fieldName.text;
        [self.delegate sandToModle:model];
    }
    
    [self.navigationController popToRootViewControllerAnimated:YES];
}
- (void)creatFieldText {
    _fieldName = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, kWidth, 100)];
    _fieldName.backgroundColor = COLORAUTO;
    [self.view addSubview:_fieldName];
    _fieldGender = [[UITextField alloc] initWithFrame:CGRectMake(0, 100, kWidth, 100)];
    _fieldGender.backgroundColor = COLORAUTO;
    [self.view addSubview:_fieldGender];
    _fieldAdress = [[UITextField alloc] initWithFrame:CGRectMake(0, 200, kWidth, 100)];
    _fieldAdress.backgroundColor = COLORAUTO;
    [self.view addSubview:_fieldAdress];
    
    _fieldTelePhone = [[UITextField alloc] initWithFrame:CGRectMake(0, 300, kWidth, 100)];
    _fieldTelePhone.backgroundColor = COLORAUTO;
    [self.view addSubview:_fieldTelePhone];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
